package com.share.example.stock.enums;

import lombok.Getter;

/**
 * @author syq
 * @data 2019/6/17
 */
@Getter
public enum StrategyEnum {
    SHIZIXIN("shizixin", "一横一竖", "最高价与最低价成十字形状"),

    COLLECT_3("collect_3", "收藏振幅>3", "当前收藏跌涨幅+-3%"),
    RATE_U8("rate_u8", "振幅>8", "当前的涨势大于8%");

    private String code;
    private String name;
    private String descript;

    StrategyEnum(String code, String name, String descript) {
        this.code = code;
        this.name = name;
        this.descript = descript;
    }

    public static StrategyEnum toEnum(final String code) {
        for (final StrategyEnum tag : StrategyEnum.values()) {
            if (tag.code.equals(code)) {
                return tag;
            }
        }
        return null;
    }
}
